Many of today's web servers dynamically generate content in response to client requests. For example, in response to a request for a current stock price, a web server may: (1) consult a database to ascertain the current price of the stock; (2) dynamically construct a response page incorporating the current stock price; and (3) send the response page to the client for rendering thereby. Typically, to generate content dynamically, a web server invokes an application, such as a common gateway interface (CGI) program or a server side plug-in. In response, the application performs most if not all of the operations required to generate the dynamic content. Then, once the content is generated, it is provided either to the client or to the web server, which in turn sends it to the client. In this manner, a dynamically generated set of information is returned to the client in response to its request.
One of the primary advantages of generating content dynamically is that it enables the server to provide the most up to date information in response to the client request. Unlike serving up static pages, which may contain stale information, generating content dynamically enables a server to ensure that the information provided to the client is current. This is important in many implementations, such as the stock quote implementation noted above. The main disadvantage of generating content dynamically is that it is much more resource intensive than serving up static pages, and hence, is typically much slower. As noted above, dynamic content is usually generated by invoking an application. This application requires time and resources to execute. Not only that, the application itself often invokes or accesses backend services, such as databases, directory servers, and the like, to obtain needed information. Accessing these services (which often requires resource intensive connections) adds to the slow response time of the server.
This poor performance is exacerbated when the server is required to service a large number of requests at a time. In many of today's servers, it is not unusual for the server to concurrently process thousands of requests. At this high request rate, if the server were to dynamically generate content in response to each request, the performance of the server would most likely degrade dramatically. As this discussion shows, dynamically generating content in response to each request is not scalable. To improve system performance in the face of high request rates, an improved mechanism for managing dynamically generated content is needed.